package Day05;

public class Demo6 {
    public static void main(String[] args) {
        int[] a={62,51,524,1821,252,25};
        int max=getMax(a);
        System.out.println("最大值为："+max);
    }
    public static int getMax(int[] arr){
        int max=arr[0];
        for (int i = 0; i <arr.length ; i++) {
            if(arr[i]>max){
                max=arr[i];
            }
        }
        return max;
    }
}
